#!/usr/bin/python
# -*- coding: utf-8 -*-

import onnx
import sys

onnx_path = sys.argv[1]
info_path = sys.argv[2]

model = onnx.load(onnx_path)
onnx.checker.check_model(model)

with open(info_path, 'w', encoding='utf-8') as f:
	for node in model.graph.node:
		f.write(f"{node.name}>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n")
		f.write(f"{node}\n\n")
		f.write("<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n\n")
